package com.hschinese.pronunciation.bean;

import com.hschinese.pronunciation.R;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by wo on 2015/10/29.
 */
public class AppResourceMap {
    public static Map<Integer, String> mFoldNameToTypeMap = null;
    public static Map<Integer, Integer> mVovelGroupIdToName = null;
    public static Map<Integer, Integer> mConsonantGroupIdToName = null;

    static {
        mFoldNameToTypeMap = new HashMap<Integer, String>();
        mFoldNameToTypeMap.put(5, "Consonants.bundle/");
        mFoldNameToTypeMap.put(2, "DoublePhone.bundle/");
        mFoldNameToTypeMap.put(7, "Excise.bundle/");
        mFoldNameToTypeMap.put(1, "ExciseFirst.bundle/");
        mFoldNameToTypeMap.put(3, "ExciseSecond.bundle/");
        mFoldNameToTypeMap.put(9, "ExcciseSecond.bundle/");
        mFoldNameToTypeMap.put(8, "ExcciseSingle.bundle/");
        mFoldNameToTypeMap.put(15, "ExcciseSecond.bundle/");
        mFoldNameToTypeMap.put(6, "NoticeMatters.bundle/");
        mFoldNameToTypeMap.put(0, "SinglePhone.bundle/");
        mFoldNameToTypeMap.put(4, "Vowels.bundle/");
    }

    static {
        mVovelGroupIdToName = new HashMap<Integer, Integer>();
        mVovelGroupIdToName.put(1, R.string.single_vowel);
        mVovelGroupIdToName.put(2, R.string.double_vowel);
        mVovelGroupIdToName.put(3, R.string.three_times_vowel);
    }

    static {
        mConsonantGroupIdToName = new HashMap<Integer, Integer>();
        mConsonantGroupIdToName.put(1, R.string.consonants_labial);
        mConsonantGroupIdToName.put(2, R.string.consonants_alveolar);
        mConsonantGroupIdToName.put(3, R.string.consonants_shegenyin);
        mConsonantGroupIdToName.put(4, R.string.consonants_tongue_tone);
        mConsonantGroupIdToName.put(5, R.string.consonants_after_the_tone_tongue);
        mConsonantGroupIdToName.put(6, R.string.consonants_before_the_tone_tongue);
    }

    public static String getMp3Fold(int type) {
        if (type >= 0 && type < 16) {
            return mFoldNameToTypeMap.get(type);
        } else return null;
    }

    public static int getVowelTypeNameId(int type) {
        return mVovelGroupIdToName.get(type);
    }

    public static int getConsonantTypeNameId(int type) {
        return mConsonantGroupIdToName.get(type);
    }
}
